package com.im.server.special.business.action;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.im.server.general.business.message.data.LoginData;
import com.im.server.general.common.message.Head;
import com.im.server.general.common.message.ResultMessage;
import com.im.server.special.business.service.SpecialPersonalService;
import com.only.general.annotation.action.ActionMapping;
import com.only.general.annotation.action.MethodMapping;
import com.only.general.annotation.parameter.Define;
import com.only.net.session.SocketSession;

/**
 * 描述： 个人信息业务处理
 * 
 * @author XiaHui
 * @date 2016年1月7日 下午7:45:48
 * @version 0.0.1
 */
@Component
@ActionMapping(value = "1.100")
public class SpecialPersonalAction {
	
	@Resource
	private SpecialPersonalService specialPersonalService;

	/**
	 * 登录
	 * 
	 * @param userMessage
	 * @param dataWrite
	 * @return
	 */
	@MethodMapping(value = "1.1.0001", isIntercept = false)
	public Object login(SocketSession socketSession, Head head, @Define("loginData") LoginData loginData) {
		ResultMessage message = specialPersonalService.login(socketSession, loginData);
		return message;
	}
	/**
	 * 处理客户端断开连接后自动连接
	 * 
	 * @param userMessage
	 * @param dataWrite
	 * @return
	 */
	@MethodMapping(value = "1.1.0002", isIntercept = false)
	public Object connect(SocketSession socketSession, @Define("loginData") LoginData loginData) {
		ResultMessage message = specialPersonalService.login(socketSession, loginData);
		return message;
	}
}
